import 'package:dirver/pages/home/tab_index/navigator_item.dart';
import 'package:dirver/widgets/common_image.dart';
import 'package:flutter/material.dart';

class NavigatorWidget extends StatelessWidget {
  const NavigatorWidget({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.only(top: 10,bottom: 10),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(4),
      ),
     child: Row(
      mainAxisAlignment: MainAxisAlignment.spaceAround,
      children: navigatorItems.map((item) => InkWell(
        onTap: () => item.onTap(context),
        child: Column(
          children: [
            CommonImage(
              src: item.imgUrl,
              fit: BoxFit.cover,
              width: 50,
              height: 50,
            ),
            SizedBox(height: 4), // 添加间距
            Text(item.title),
          ],
        ),
      )).toList(),
     ), 
    );
  }
}